package com.liyingtao.biz;

import com.liyingtao.bean.Board;
import com.liyingtao.dao.TopicMapper;
import com.liyingtao.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class TopicService {

    SqlSession session=SqlSessionFactoryUtil.getSqlSession();
    TopicMapper topicmapper=session.getMapper(TopicMapper.class);
    public int addBoardMethod(Board board){
        int flag=topicmapper.addBoardMethod(board);
        session.commit();
       return flag;
    }

    public List<Board> getAllBoard(){
        return topicmapper.getAllBoard();
    }
}
